<template>
  <div id="userMiddle">
    <div id="introduction">
      <span class="text">简介：</span>
      <span class="content">{{checkIntroduction}}</span>
    </div>
    <div id="edit">
      <a href="javascript:;"
         @click="editClick"><img src="~assets/img/profile/user/bianji.png"></a>
    </div>
  </div>
</template>

<script>
  export default {
    name: "userMiddle",
    data(){
      return{
        introduction: '请先登录哟',
      }
    },
    computed:{
      checkIntroduction: {
        get:function () {
          return this.introduction == null ? '(- -)/ 哟' : this.introduction
        },
      }
    },
    /*props:{
      introduction: {
        type: String,
        default() {
          return '(- -)/ 哟';
        }
      }
    },*/
    methods:{
      editClick(){
        this.$router.push('/editInform')
      }
    },
    mounted() {
      let user = JSON.parse(localStorage.getItem('user'))
      this.introduction = user.brefIntroduction;
    }
  }
</script>

<style scoped>
#userMiddle{
  width: 90%;
  height: 23%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}
  #introduction{
    width: 73%;
    color: #f6f6f6;
  }
  #introduction .text{
    font-size: 12px;
  }
  #introduction .content{
    font-size: 14px;
  }
  #edit{
    width: 120px;
    display: flex;
    align-items: center;
  }
  #edit a{
    display: block;
  }
  #edit a img{
    width: 100%;
  }
</style>
